<%@ page import="java.sql.ResultSet" %>
<%@ page import="br.com.rosena.control.ControllerRosena" %>
<%@ page import="java.sql.Date" %>
<%@ include file="../abrirEvento.jsp" %>

<%
    String idEvento = request.getParameter("idEvento") != null ? request.getParameter("idEvento") : "";
    String sqlFotos = "SELECT F.ARQUIVO, E.EDICAO AS EVENTO , E.datainicioevento, E.datafinalevento  FROM FOTO F , EVENTO E WHERE F.EVENTO = E.ID AND E.ID = " + idEvento + " ORDER BY E.ID ";
    ResultSet crsFotos = new ControllerRosena().execultarQueryReturResultSet(sqlFotos);

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title><%=tituloPagina%></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link href="css/style.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="css/coin-slider.css"/>

    <script src="lightbox/js/jquery-1.7.2.min.js"></script>

    <script type="text/javascript" src="js/cufon-yui.js"></script>
    <script type="text/javascript" src="js/cufon-georgia.js"></script>
    <script type="text/javascript" src="js/script.js"></script>
    <script type="text/javascript" src="js/coin-slider.min.js"></script>

    <script src="lightbox/js/lightbox.js"></script>
    <link href="lightbox/css/lightbox.css" rel="stylesheet" />
    <style>

    #my-header-new a, #my-header-new a:hover {
       color: #c2cae0;
    }

    #my-header-new a:hover {
        text-decoration: none
    }
    </style>
</head>
<body>
<div class="main">
<div id="structure">
<%@ include file="cabecalho.jsp" %>
<div class="content">
    <div class="content_resize">
        <div class="mainbar">
            <div class="article">
                <%String evento = "";%>
                <%while (crsFotos.next()) {
                    String arquivo = crsFotos.getString("arquivo");
                    Date dataInicioEvento = crsFotos.getDate("datainicioevento");
                    Date dataFinalEvento = crsFotos.getDate("datafinalevento");

                    String diaInicioEvento = br.com.rosena.util.Util.formatarData(dataInicioEvento, "dd");
                    String mesInicioEvento = br.com.rosena.util.Util.mesAno(dataInicioEvento);

                    String diaFinalEvento = br.com.rosena.util.Util.formatarData(dataFinalEvento, "dd");
                    String mesFinalEvento = br.com.rosena.util.Util.mesAno(dataFinalEvento);

                    if (!evento.equals(crsFotos.getString("EVENTO"))) {%>
                        <b><h3>FOTOS DO <%=br.com.rosena.util.Util.getNumeroRomano(crsFotos.getInt("EVENTO"))%> SILE <%=diaInicioEvento%>/<%=mesInicioEvento%> a <%=diaFinalEvento%>/<%=mesFinalEvento%>:</h3><br></b>
                    <%}%>
                    <a href="../../<%=arquivo%>"  rel="lightbox[roadtrip]"><img src="../../<%=arquivo%>" width="150" height="150" alt="" class="gal"/></a>
                    <%evento = crsFotos.getString("EVENTO");%>
                <%}%>
             </div>
        </div>
        <div class="sidebar">
            <%@ include file="menu.jsp" %>
            <%@ include file="apoio.jsp" %>
        </div>
        <div class="clr"></div>
    </div>
</div>
<%@ include file="rodape.jsp" %>
<%@ include file="copyright.jsp" %>
</div>
</div>
</body>
</html>
